import Request from '@/api/request'
var request = new Request().http

//商品类别接口
export function getNameAndId() {
	return request({
		url: "/applet/product-category/getNameAndId",
		method: "Get"
	})
}

//获取义购之家商品
export function getProduct(data : any) {
	return request({
		url: "/applet/home-product/getProduct",
		method: "Get",
		data
	})
}
//义购之家商品详情
export function getProductInfo(data : any) {
	return request({
		url: "/applet/home-product/getProductInfo",
		method: "Get",
		data
	})
}
//义购之家库存
export function getInventoryInfo(data : any) {
	return request({
		url: "/applet/home-product/getInventoryInfo",
		method: "Get",
		data
	})
}
//地址查询
export function deliveryAddress() {
	return request({
		url: "/applet/deliveryAddress/list",
		method: "Get",
	})
}
//地址新增
export function deliveryAddressadd(data:any) {
	return request({
		url: "/applet/deliveryAddress/add",
		method: "Post",
		data
	})
}

//地址修改
export function deliveryAddressupdate(data:any) {
	return request({
		url: "/applet/deliveryAddress/update",
		method: "Put",
		data
	})
}

//地址删除
export function deliveryAddressdelete(data:any) {
	console.error(data)
	return request({
		url: "/applet/deliveryAddress/delete",
		method: "delete",
		data
	})
}

//地址默认
export function deliveryAddressdefault(data:any) {
	return request({
		url: "/applet/deliveryAddress/default",
		method: "Put",
        data		
	})
}



